package com.zzb.weixin.model.datacube;

import com.zzb.weixin.constant.WXJsonName;
import com.zzb.weixin.json.JsonObject;

/**
 * Created by user on 2016/3/18.
 */
public class Merchandise {
    private int quantity;
    public Merchandise(JsonObject jo) {
        if(jo != null){
            if(0 == jo.getAsInt(WXJsonName.ERR_CODE)){
            	try {
            		quantity = jo.getAsJsonObject("product_info").getAsJsonArray("sku_list").getAsJsonObject(0).getAsInt("quantity");
				} catch (Exception e) {
					quantity = 0;
				}
            	
            }
        }
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }
}
